from flask_wtf import Form
from wtforms import StringField,RadioField,DateField,DecimalField,SelectField
from wtforms import BooleanField ,PasswordField
from wtforms import validators

class EmployeeForm(Form):
    name = StringField('姓名')
    gender = RadioField('性别',default='男', choices=[('男','男'),('女','女')])
    job = StringField('职位',default='工程师')
    birthdate = DateField('生日')
    idcard = StringField('身份证号')
    address = StringField('地址')
    salary = DecimalField('工资')
    department_id = SelectField('部门')

class RegUserForm(Form):
    username =StringField('用户名',[validators.DataRequired('用户名必需填！'),validators.Length(min=4,max=20,message='用户名需在4-20个字符之间！')])
    email = StringField('邮箱',[validators.Email('邮箱格式不正确')])
    password = PasswordField('密码',[validators.DataRequired,validators.Length(min=6,max=20)])
    confirm = PasswordField('重复密码',[validators.EqualTo('password',message='两次密码不一致！')])
    accept= BooleanField('接受协议',[validators.DataRequired('同意协议才能注册！')])
